package com.example.demo.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.dao.ChatRoomDao;
import com.example.demo.entity.ChatRoom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomDao,ChatRoom> implements ChatRoomService {
    @Autowired
    private ChatRoomDao chatRoomDao;

    public List<ChatRoom> getAllChatRooms() {
        return chatRoomDao.getAllChatRooms();
    }

    public void createChatRoom(ChatRoom chatRoom) {
        chatRoomDao.insert(chatRoom);
    }

    public ChatRoom getChatRoomById(long id) {
        return chatRoomDao.getChatRoomById(id);
    }
}